package com.duoduo.springcloud.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ConfigClientController
 *
 * @author qian
 * @version 1.0
 * @date 2020/11/30 11:25
 */
@RestController
@RefreshScope //curl -X POST "http://localhost:3355/actuator/refresh" 需要运维人员发送post请求
public class ConfigClientController {

    @Value("${config.info}")
    private String configInfo;

    @Value("${server.port}")
    private String serverPort;

    @GetMapping("/config-info")
    public String getConfigInfo(){
        return "端口:"+serverPort+",info:"+configInfo;
    }
}
